package day10.handler.simpleChannelHandler;

import day10.packet.MessageResponsePacket;
import day10.util.LoginUtil;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;

import java.util.Date;

/**
 * @author chenshijie
 * @date 2023/12/26 13:39
 */

public class MessageResponseHandler extends SimpleChannelInboundHandler<MessageResponsePacket> {
    @Override
    protected void channelRead0(ChannelHandlerContext ctx, MessageResponsePacket messageResponsePacket) throws Exception {

        System.out.println(ctx.channel() + "老子收到了");
        int fromUserId = messageResponsePacket.getFromUserId();
        String fromUserName = messageResponsePacket.getUserName();
        System.out.println("用户id" + fromUserId + ":用户名" + fromUserName + " -> " + messageResponsePacket.getMessage());


    }
}
